﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BusinessLoginLayer
{
    public partial class Airports
    {
        public static CommonClasses.Airport[] GetAll()
        {
            using (PlanesManagerEntity entity = new PlanesManagerEntity())
            {
                CommonClasses.Airport[] airports = (from ent in entity.GetAirportList()
                                                               select new CommonClasses.Airport()
                                                               {
                                                                   AirportName = ent.Name,
                                                                   AirportCity = ent.City,
                                                               }).ToArray();
                return airports;
            }
        }
    }
}
